<template>
  <van-swipe-cell>
    <div class="list">
      <div class="box">
        <img :src="list.head_img" alt="" />
        <div class="center">
          <p>{{ list.nickname }}</p>
          <span>2019-9-9</span>
        </div>
        <!--  <span>取消关注</span> -->
      </div>
    </div>
    <template #right>
      <van-button
        square
        text="取消关注"
        type="danger"
        class="delete-button"
        @click="del(list.id)"
      />
    </template>
  </van-swipe-cell>
</template>

<script>
export default {
  props: {
    list: {
      type: Object,
    },
  },
  methods: {
    del(id) {
      this.$emit("unpost", id);
    },
  },
};
</script>

<style lang="less" scoped>
.list {
  .box {
    display: flex;
    padding: 25px 10px;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ccc;
    > img {
      display: block;
      width: 50/360 * 100vw;
      height: 50/360 * 100vw;
      border-radius: 50%;
      padding: 0 10px;
    }
    > .center {
      flex: 1;
      > p {
        line-height: 30px;
        font-size: 14px;
      }
      > span {
        font-size: 12px;
        color: #999;
      }
    }
    > span {
      height: 30px;
      background-color: #eee;
      font-size: 13px;
      border-radius: 30px;
      line-height: 30px;
      padding: 0px 15px;
    }
  }
}
.goods-card {
  margin: 0;
  background-color: white;
}

.delete-button {
  height: 100%;
}
.delete-button[data-v-0efe1c3a] {
  width: 59px;
}
</style>